import React from 'react'
import ReactDOM from 'react-dom/client'
import './index.scss'
import App from './App'
import reportWebVitals from './reportWebVitals'

// 创建hash路由
import { HashRouter as Router } from 'react-router-dom'
// 通过 ConfigProvider 进行主题配置
import { ConfigProvider } from 'antd'

// 导入store
import store from './store'
// 从react-redux导出Provider建立redux和react的关联关系
import { Provider } from 'react-redux'

// i18配置
import locale from 'antd/locale/zh_CN'
import 'dayjs/locale/zh-cn'
const root = ReactDOM.createRoot(document.getElementById('root'))
root.render(
  <React.StrictMode>
    <Provider store={store}>
      {/* 绑定路由 */}
      <Router>
        <ConfigProvider
          locale={locale}
          theme={{
            // 这是全局的主题变量配置
            // token: { colorPrimary: '#f00' },
            // 组件的主题变量配置
            components: {
              // 面包屑导航组件的主题变量配置
              Breadcrumb: {
                // lastItemColor: 'rgba(0,0,0)',
                // linkColor: 'rgba(0,0,0,.5)',
              },
            },
          }}
        >
          <App />
        </ConfigProvider>
      </Router>
    </Provider>
  </React.StrictMode>
)

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals()
